package com.ra.landlord;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ra.system.Version;

/**
 * 某房间的配置规则
 * 
 * @author colin
 *
 */
@Entity
@Table(name = "ra_roomitem")
public class RoomItem implements Version, LandlordOwner{
	
	private Integer id;
	
	private Room room;
	
	private RoomItemCfg roomItemCfg;
	
	private LandlordOwnerUser landlordUser;
	
	private Integer version;
	
	private Integer status;

	@Id
	@GeneratedValue
	@Column(name = "relationId")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(targetEntity=Room.class, fetch=FetchType.LAZY)
	@JoinColumn(name = "MasterId")
	public Room getRoom() {
		return room;
	}

	public void setRoom(Room room) {
		this.room = room;
	}

	@ManyToOne(targetEntity=RoomItemCfg.class, fetch=FetchType.LAZY)
	@JoinColumn(name = "SecondaryId")
	public RoomItemCfg getRoomItemCfg() {
		return roomItemCfg;
	}

	public void setRoomItemCfg(RoomItemCfg roomItemCfg) {
		this.roomItemCfg = roomItemCfg;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "createuserid")
	public LandlordOwnerUser getLandlordUser() {
		return landlordUser;
	}

	public void setLandlordUser(LandlordOwnerUser landlordUser) {
		this.landlordUser = landlordUser;
	}
	
	@Column(name = "version_id")
	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "data_status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

}